<!-- PersonalCenter.vue -->
<template>
  <div class="personal-center">
    <HeaderComponents/>

    <div class="card">
      <div class="card-header">
        <h2>个人中心</h2>
      </div>

      <div class="content-wrapper">
        <div class="sidebar">
          <div class="menu">
            <router-link
                v-for="item in menuItems"
                :key="item.path"
                :to="'/personal/' + item.path"
                active-class="active"
            >
              <i :class="'icon-' + item.icon"></i>
              {{ item.title }}
            </router-link>
          </div>
        </div>

        <div class="main-content">
          <router-view></router-view>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import HeaderComponents from "@/components/HeaderComponents.vue";

export default {
  name: 'PersonalCenter',
  components: {HeaderComponents},
  data() {
    return {
      menuItems: [
        { path: 'profile', title: '个人资料', icon: 'user' },
        { path: 'posts', title: '我的帖子', icon: 'document' },
        { path: 'followers', title: '我的粉丝', icon: 'star' },
        { path: 'favorites', title: '我的收藏', icon: 'collection' },
        { path: 'feedback', title: '反馈与帮助', icon: 'question' },
        { path: 'privacy', title: '隐私设置', icon: 'lock' },
        { path: 'deactivate', title: '账号注销', icon: 'warning' }
      ]
    }
  }
}
</script>

<style scoped>
.personal-center {
  padding: 20px;
}

.card {
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.card-header h2 {
  margin: 0;
  color: #455a64;
}

.content-wrapper {
  display: flex;
}

.sidebar {
  width: 220px;
  padding: 20px;
  border-right: 1px solid #e0e0e0;
}

.menu {
  display: flex;
  flex-direction: column;
}

.menu a {
  padding: 12px 15px;
  color: #607d8b;
  text-decoration: none;
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  border-radius: 4px;
  transition: all 0.3s;
}

.menu a:hover {
  background-color: #f5f7fa;
  color: #1976d2;
}

.menu a.active {
  background-color: #e3f2fd;
  color: #1976d2;
}

.menu i {
  margin-right: 10px;
  font-size: 16px;
}

.main-content {
  flex: 1;
  padding: 20px;
}
</style>